package org.foxas.ui
{
	import flash.display.Sprite;
	
	import org.foxas.base.FGeom;

	public class FSelectRim extends Sprite
	{
		private var rim:Sprite = new Sprite;
		public function FSelectRim()
		{
			super();
			FGeom.DrawRect(this.rim,0,0,100,100,0x666666,0.3,0x222222,0.8);
			this.addChild(rim);
			this.visible = false;
		}
		public override function set visible(_v:Boolean):void{
			super.visible = _v;
			if(_v==false){
				this.x = 0;
			}
		}
		public function build(_x0:Number,_y0:Number,_x1:Number,_y1:Number):void{
			var tx:Number = _x0 - _x1;
			var ty:Number = _y0 - _y1;
			if(tx>=0){
				this.x = _x1;
				this.width = tx;
			}else{
				this.x = _x0;
				this.width = -1*tx;
			}
			if(ty>=0){
				this.y = _y1;
				this.height = ty;
			}else{
				this.y = _y0;
				this.height= -1*ty;
			}
			this.visible=true;
		}
	}
}